package org.fly.jingwei.service;

import org.fly.jingwei.bean.PageForBean;
import org.fly.jingwei.entity.UserEntity;
import org.fly.jingwei.entity.UserGroupAttributeEntity;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * @author leo.jie (weixiao.me@aliyun.com)
 * @version 1.0
 * @organization bigdata
 * @website https://www.jielongping.com
 * @date 2020/5/28 11:29 下午
 * @since 1.0
 */
public interface UserService {
    /**
     * 删除用户
     *
     * @param id
     * @param username
     */
    void deleteUser(Integer id, String username);

    /**
     * 更新用户
     *
     * @param user
     * @param attr
     */
    void updateUser(UserEntity user, UserGroupAttributeEntity attr);

    /**
     * 添加用户
     *
     * @param user
     * @param attribute
     * @return
     */
    boolean addUser(UserEntity user, UserGroupAttributeEntity attribute);

    /**
     * 分页获取用户
     *
     * @param start
     * @param limit
     * @param request
     * @return
     */
    String getUsersLimit(int start, int limit, HttpServletRequest request);

    /**
     * 根据用户名获取用户
     *
     * @param login
     * @return
     */
    List<UserEntity> getUserByName(String login);

    /**
     * 用户登录
     *
     * @param userName
     * @param password
     */
    void login(String userName, String password);

    /**
     * 分配用户组
     *
     * @param attr
     */
    void allotUserGroup(UserGroupAttributeEntity attr);

    /**
     * 获取用户
     *
     * @param userGroupName
     * @return
     */
    List<UserEntity> getUsers(String userGroupName);

    /**
     * 更新密码
     *
     * @param user
     */
    void updatePassword(UserEntity user);
}
